package com.tour.pojo;

import java.util.Date;

public class User {
    private Integer userId;

    private String username;

    private String password;

    private String realname;

    private String email;

    private String phone;

    private String question;

    private String answer;

    private Integer cardType;

    private String cardNo;

    private Integer gender;

    private Date birthday;

    private String address;

    private Date createTime;

    private Date updateTime;

    private Date lastLoginTime;

    private Integer role;
    
    private boolean isFreeze;
    
    @Override
	public String toString() {
		return "User [userId=" + userId + ", username=" + username + ", password=" + password + ", realname=" + realname
				+ ", email=" + email + ", phone=" + phone + ", question=" + question + ", answer=" + answer
				+ ", cardType=" + cardType + ", cardNo=" + cardNo + ", gender=" + gender + ", birthday=" + birthday
				+ ", address=" + address + ", createTime=" + createTime + ", updateTime=" + updateTime
				+ ", lastLoginTime=" + lastLoginTime + ", role=" + role + ", genderName=" + this.getGenderName() + ", roleName="
				+ this.getRoleName() + "]";
	}

	//需要显示的字符串
    private String genderName;
    private String roleName;
    private String freezeStr;

    public User(Integer userId, String username, String password, String realname, String email, String phone, String question, Integer role, String answer, Integer cardType, String cardNo, Integer gender, Date birthday, String address, Date createTime, Date updateTime, Date lastLoginTime, Boolean isFreeze) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.realname = realname;
        this.email = email;
        this.phone = phone;
        this.question = question;
        this.role = role;
        this.answer = answer;
        this.cardType = cardType;
        this.cardNo = cardNo;
        this.gender = gender;
        this.birthday = birthday;
        this.address = address;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.lastLoginTime = lastLoginTime;
        this.isFreeze = isFreeze;
    }

    public User() {
        super();
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname == null ? null : realname.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question == null ? null : question.trim();
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer == null ? null : answer.trim();
    }

    public Integer getCardType() {
        return cardType;
    }

    public void setCardType(Integer cardType) {
        this.cardType = cardType;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo == null ? null : cardNo.trim();
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Integer getRole() {
        return role;
    }

    public void setRole(Integer role) {
        this.role = role;
    }

	/**
	 * @return the roleName
	 */
	public String getRoleName() {
		if(this.role==0){
			return "管理员";
		}else if(this.role==1){
			return "会员";
		}else if(this.role==2){
			return "普通用户";
		}
		return roleName;
	}

	/**
	 * @param roleName the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	/**
	 * @return the genderName
	 */
	public String getGenderName() {
		if(this.gender==0){
			return "女";
		}else if(this.gender==1){
			return "男";
		}
		return genderName;
	}

	/**
	 * @param genderName the genderName to set
	 */
	public void setGenderName(String genderName) {
		this.genderName = genderName;
	}

	/**
	 * @return the isFreeze
	 */
	public boolean isFreeze() {
		return isFreeze;
	}

	/**
	 * @param isFreeze the isFreeze to set
	 */
	public void setFreeze(boolean isFreeze) {
		this.isFreeze = isFreeze;
	}

	/**
	 * @return the freezeStr
	 */
	public String getFreezeStr() {
		if(isFreeze){
			return "冻结";
		}else{
			return "正常";
		}
	}

	/**
	 * @param freezeStr the freezeStr to set
	 */
	public void setFreezeStr(String freezeStr) {
		this.freezeStr = freezeStr;
	}
}